package com.example.demo.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin             //解决跨域问题，不再单写cors实现wevmvcconfig了
public class UserController {
    @RequestMapping("/login")
    public String login(String username, String password) {
        if (username.equals("123") && password.equals("123456")) {
            return "登录成功!";
        } else {
            return "登录失败";
        }
    }

    @RequestMapping("next")
    public String next() {
        return "这里是下一页";
    }

}
